<template>
	<el-button
		:type="Status"
		:class="{
      'shake':needShake ,
      'shake-base':needShake,
      'shake-constant':needShake ,
      'hover-stop':needShake,
      'big-font':true
      }"
		@click="beclick"
		size="mini"
	>
		{{title}}
	</el-button>
</template>

<script>
export default {
	name: "ShakeButton",
	data() {
		return {
			// needShake: false,
			title: "紧急灾害(无)"
		};
	},
	computed: {
		Status: function () {
			if (this.needShake) {
				return "danger";
			} else {
				return "primary";
			}
		}
	},
	props: {
		info: {
			type: Object,
			default: () => {
				return {
					title: ""
				};
			}
		},
		needShake: {
			type: Boolean,
			defalut: false
		}
	},
	watch: {
		needShake: function () {
			if (this.needShake) {
				this.title = "紧急灾害报警";
			} else {
				this.title = "紧急灾害(无)";
			}
			// this.$emit('notDanger');
		}
	},
	methods: {
		beclick: function () {
    		this.$emit("beclick")
		}
	}
};
</script>

<style scoped>
.el-button--mini {
	padding: 5px;
}

.el-button {
	font-size: 10px !important;
	font-weight: bold !important;
}
</style>